package com.yunxi.order.pojo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.yunxi.core.web.DateJsonDeserializer;
import com.yunxi.sys.pojo.AttachVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 零售订单
 * </p>
 *
 * @author
 * @since 2019-06-05
 */
@Data
@ApiModel(value="OrderCustomer对象", description="零售订单")
public class OrderCustomerVO implements Serializable {

    @ApiModelProperty(value = "订单ID")
    private String orderCustomerId;

    @ApiModelProperty(value = "零售单编号")
    private String orderCustomerNo;

    @ApiModelProperty(value = "渠道商编号")
    private String partnerCode;

    @ApiModelProperty(value = "客户编号")
    private String customerNo;

    private String customerName;

    @ApiModelProperty(value = "是否支付定金")
    private Integer isFrontPay;

    @ApiModelProperty(value = "定金金额")
    private BigDecimal frontMoney;

    @ApiModelProperty(value = "付款方式")
    private String paytype;

    @ApiModelProperty(value = "发票编号")
    private String invoiceCode;

    @ApiModelProperty(value = "保险公司")
    private String insurerType;

    @ApiModelProperty(value = "开票日期")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date invoiceTime;

    @ApiModelProperty(value = "交定日期")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date deliveryDate;

    @ApiModelProperty(value = "预计交车日期")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date deliveryCarDate;

    @ApiModelProperty(value = "保单号")
    private String insuranceNo;

    @ApiModelProperty(value = "上牌日期")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date carLicense;

    @ApiModelProperty(value = "车牌号")
    private String carNo;

    @ApiModelProperty(value = "车主类型")
    private String drivierType;

    @ApiModelProperty(value = "客户类型")
    private String customerType;

    @ApiModelProperty(value = "提货方式 N承运 Y 自提")
    private String deliveryType;

    @ApiModelProperty(value = "订单来源 1App 2 PC 3pad 9 后台录入")
    private Integer orderSource;

    @ApiModelProperty(value = "1：零售整车2： 直客整车")
    private Integer orderType;

    @ApiModelProperty(value = "支付id")
    private String payId;

    @ApiModelProperty(value = "是否退定")
    private Integer isFrontRefund;

    @ApiModelProperty(value = "订单金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "合同编号")
    private String contractNo;

    @ApiModelProperty(value = "数量只会是1")
    private Integer num;

    @ApiModelProperty(value = "是否有库存")
    private String isLowStock;

    @ApiModelProperty(value = "备注")
    private String info;

    @ApiModelProperty(value = "创建时间")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "修改时间")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date updateTime;

    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @ApiModelProperty(value = "状态1启用0禁用")
    private Integer status;

    @ApiModelProperty(value = "是否删除")
    private Integer isDel;

    @ApiModelProperty(value = "备注")
    private String memo;

    @ApiModelProperty(value = "版本")
    private Integer version;

    @ApiModelProperty(value = "是否发送")
    private Integer isSend;

    @ApiModelProperty(value = "用户的aiid")
    private String customerId;

    @ApiModelProperty(value = "用户手机号")
    private String customerMobile;

    @ApiModelProperty(value = "用户证件号")
    private String certNo;

    @ApiModelProperty(value = "证件类型")
    private String certType;

    @ApiModelProperty(value = "下订单的企业名称")
    private String companyName;

    @ApiModelProperty(value = "下订单的企业代码(统一社会信用代码)")
    private String companyCode;

    @ApiModelProperty(value = "客户地址")
    private String customerAddress;

    @ApiModelProperty(value = "省编号")
    private String provinceCode;

    @ApiModelProperty(value = "提车城市")
    private String cityCode;

    @ApiModelProperty(value = "邀请人姓名")
    private String invitorName;

    @ApiModelProperty(value = "邀请人手机")
    private String invitorMobile;

    @ApiModelProperty(value = "订单状态1-->待付款2-->小订付款完成3-->大订已付款，4-->订单已评价5-->已超时6-->小订已取消" +
            "7-->小订申请退款8-->小订退款成功 9-->小订退款失败 10-->同意取消 11-->驳回取消")
    private Integer orderStatus;

    @ApiModelProperty(value = "订单流水号")
    private String orderNo;

    @ApiModelProperty(value = "预定的产品包id")
    private String productPackageId;

    @ApiModelProperty(value = "支付金额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "优惠金额")
    private BigDecimal discountAmount;

    @ApiModelProperty(value = "订车类型 1个人 2企业")
    private String bookingType;

    @ApiModelProperty(value = "车主姓名")
    private String driverName;

    @ApiModelProperty(value = "车主电话")
    private String driverTel;

    @ApiModelProperty(value = "提车人姓名")
    private String takeCarName;

    @ApiModelProperty(value = "提车人电话")
    private String takeCarTel;

    @ApiModelProperty(value = "业务类型0 小订 1 大订")
    private Integer busType;

    @ApiModelProperty(value = "业务状态")
    private Integer busStatus;

    @ApiModelProperty(value = "VIN")
    private String vin;

    @ApiModelProperty(value = "支付流水号")
    private String outTradeNo;

    @ApiModelProperty(value = "状态名称")
    private String statusName;

    @ApiModelProperty(value = "订单来源名称")
    private String sourceName;

    @ApiModelProperty(value = "订车类型名称")
    private String bookingTypeName;

    @ApiModelProperty(value = "渠道商名称")
    private String partnerName;

    @ApiModelProperty(value = "同款车数量")
    private String orderSum;

    @ApiModelProperty(value = "渠道商是否分配销售顾问 0未分配 1已分配")
    private String isAssignSaler;

    @ApiModelProperty(value = "厂端是否分配渠道商 0未分配 1已分配")
    private String isAssign;

    @ApiModelProperty(value = "渠道商是否分配车辆 0未分配 1已分配")
    private String isAssignCar;

    @ApiModelProperty(value = "订单明细")
    private OrderCustomerDetailVO orderCustomerDetailVO;

    @ApiModelProperty(value = "订单附加")
    private List<OrderCustomerFeatureVO> orderCustomerFeatureVOList = new ArrayList<OrderCustomerFeatureVO>();

    @ApiModelProperty(value = "附件")
    private List<AttachVO> attachVOList = new ArrayList<AttachVO>();

    private Integer isCancel;       //是否退订
    private String cancelReason;  //退订原因
    private Integer cancelAudit;    //退订审核状态
    private String cancelAuditCn;
    private String auditUserId;    //审核人
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date cancelDate; //取消时间
    @JsonDeserialize(using = DateJsonDeserializer.class)
    private Date auditDate;

    private String orderId;
    private String idImgPath1;
    private String idImgPath2;
    private String busTypeCn;

    private BigDecimal smallAmount;//小订金额
    @JsonDeserialize(using=DateJsonDeserializer.class)
    private Date smallPayDate;//付款时间
    private Integer smallPayPath;//付款途径
    private BigDecimal bigAmount;//大订金额
    @JsonDeserialize(using=DateJsonDeserializer.class)
    private Date bigPayDate;//	大订时间
    private Integer bigPayPath;//大订途径

    private String vehicleName;

    public void setCancelAudit(Integer cancelAudit) {
        this.cancelAudit = cancelAudit;
        if(cancelAudit!=null){
            //this.cancelAuditCn ;
            if(cancelAudit==1){
                this.cancelAuditCn = "待审核";
            }else if(cancelAudit==2){
                this.cancelAuditCn = "审核通过";
            }else if(cancelAudit==3){
                this.cancelAuditCn = "审核驳回";
            }
        }
    }

    private BigDecimal finalAmount;//	尾款金额
    @JsonDeserialize(using=DateJsonDeserializer.class)
    private Date finalDate;	//尾款时间
    private Integer finalPayPath;//尾款途径
    private Integer payStyle;	//付款方式
    private String orderCarId;//订货单号

    private String colorNameIn;
    private String colorNameOut;
    private String colorCodeIn;
    private String colorCodeOut;
    private String createByName;
    private String regionCode; //区
    private String fullAreaName;

    public void setBusType(Integer busType) {
        this.busType = busType;
        if(busType!=null){
            if(busType==0)
            {
                this.busTypeCn = "小订";
            }else{
                this.busTypeCn = "大定";
            }
        }
    }

    @ApiModelProperty(value = "是否安装充电桩0否1是")
    private Integer isChargingPoint;

    @ApiModelProperty(value = "销售顾问编号")
    private String salesConsultantNo;

    @ApiModelProperty(value = "贷款公司")
    private String lender;

    @ApiModelProperty(value = "贷款期数")
    private Integer loanPeriods;

    @ApiModelProperty(value = "合同图片地址")
    private String contractImgPath;

    @ApiModelProperty(value = "客户性别(性别(Sex_Type,1男,2女)")
    private String sex;

    @ApiModelProperty(value = "客户姓名")
    private String name;

    @ApiModelProperty(value = "客户电话")
    private String phone;

    @ApiModelProperty(value = "客户级别(Customer_IntentionLevel,1O,2H,3A,4B,5C,6其他)")
    private String level;

    @ApiModelProperty(value = "开票金额")
    private BigDecimal invoiceMoney;

    @ApiModelProperty(value = "产品名称")
    private String productName;


    @ApiModelProperty(value = "销售顾问姓名")
    private String staffName;

    @ApiModelProperty(value = "交车表主键")
    private String handleId;

    @ApiModelProperty(value = "姓名或手机号")
    private String nameOrTelephone;

    @ApiModelProperty(value = "大区")
    private String bigRegion;

    @ApiModelProperty(value = "购车方案 1-->购车 2-->体验车 3-->畅想车")
    private Integer buyType;

    private String buyTypeName;

    @ApiModelProperty(value = "订单名称")
    private String orderSubject;

    @ApiModelProperty(value = "预估金额")
    private BigDecimal orderAmount;

    @ApiModelProperty(value = "国家补贴")
    private BigDecimal stateSubsidy;

    @ApiModelProperty(value = "地方补贴")
    private BigDecimal localSubsidy;

    @ApiModelProperty(value = "客户经理id")
    private String fellowId;

    @ApiModelProperty(value = "客户经理姓名")
    private String fellowName;

    @ApiModelProperty(value = "客户经理手机号")
    private String fellowMobile;

    @ApiModelProperty(value = "客户经理性别")
    private String fellowGender;

    @ApiModelProperty(value = "客户经理头像url")
    private String fellowAvatar;

    @ApiModelProperty(value = "能量值")
    private String energyPoint;

    @ApiModelProperty(value = "车辆状态1待生产2生产计划3进焊装4出焊装5进涂装6出涂装7进总装8出总装9车辆下线10VDC未入道闸" +
            "11VDC入库12VDC出库13退货入库14在途15渠道收车16渠道入库17零售出库18零售退货")
    private Integer vehicleStatus;

    @ApiModelProperty(value = "购车金额")
    private BigDecimal buyAmount;

    @ApiModelProperty(value = "驳回原因")
    private String rejectReason;

    @ApiModelProperty(value = "交付专员姓名")
    private String handleStaffName;

    @ApiModelProperty(value = "交车人")
    private String handleUser;

    @ApiModelProperty(value = "是否退款")
    private Integer isCancelMoney;

    @ApiModelProperty(value = "是否退车")
    private Integer isCancelVehicle;

    private String taskId;
    private String instanceId;
    private String taskStatus;

    private String refundOrderNo;//退款申请单号
    private String provinceName;
    private String cityName;
    private String regionName;
    private Date hireStartDate;
    private Date hireEndDate;

    private String customPackCode;
    private String customPackName;

    @ApiModelProperty(value = "征信审核状态1待审批，2已通过，3已驳回,4退回补件,5已确认")
    private Integer creditStatus;
    private Integer dayed;

    @ApiModelProperty(value = "是否转批售或绑定订货单0否1是")
    private String isConvertBatch;

    @ApiModelProperty(value = "结束时间")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "开始时间")
    @JsonDeserialize(using = DateJsonDeserializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date startTime;

    @ApiModelProperty(value = "是否pms操作修改订单0否1是")
    private String isPmsOp;

    @ApiModelProperty(value = "是否上传合同图片0否1是")
    private String isUpload;

    @ApiModelProperty(value = "金融类型 1.金融机构2.银行分期")
    private String finProduct;

    private String vehicleCode;

    private Integer isHide;//是否隐藏 0否1是

    private String packName;//选装包名称

    private Integer isAct;//是否实销上报 0否1是

    private String curSys;//访问来源sat:销售助手

    private String isCredit;//是否关联征信0否1是

    private String orderNoPrefix;//订单号参数前缀

}
